package com.hxs.hxsserver.controller.menu;

import com.hxs.hxsserver.controller.BaseController;
import com.hxs.hxsserver.domain.dto.JsonResult;
import com.hxs.hxsserver.domain.entity.user.Menu;
import com.hxs.hxsserver.mapper.user.UserMapper;
import com.hxs.hxsserver.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liuchuan
 * @create 2024/10/17
 */
@Slf4j
@RestController
@Api(value = "菜单管理")
@RequestMapping("menu")
public class MenuController extends BaseController {

    @Resource
    private UserService userService;


    @GetMapping("/getMenuList")
    @ApiOperation(value = "获取菜单列表")
    public JsonResult<List<Menu>> getMenuList(){
        return JsonResult.success(userService.getMenuList(getUserId()));
    }
}
